const mongoose = require('mongoose');

let Core = require('./core');

let Mongo = {
	init: () => {
		mongoose.connect(Core.Config.MONGO_CONNECT_URI, Core.Config.MONGO_CONNECT_OPTION);
		let conn = mongoose.connection;
		conn.once('open', () =>
			Core.Log.i("Mongoose connection")
		).on('error', (error) => {
			console.warn('Warning', error);
		});
	}
};

module.exports = Mongo;

